package edu.buffalo.cse.cse486_586.util;

import android.net.Uri;
import android.provider.BaseColumns;

public class AppUtil {
	public final static String TAG = "APPUTIL";

	// totally for testing
	public final static int numDev = 1;
	// data bundle key
	public static final String KEY = "key";
	public static final String VALUE = "value";
	public static final String RESULT = "result";
	public static final String EMULATOR_IP = "10.0.2.2";
	public static final int MASTER_CONSOLE_PORT = 5554;
	public static final int STEP_PORT = 2;
	public static final int MASTER_REDIRCT_PORT = 11108;
	public static final int STEP_REDIRCT = 4;
	public static final String DELIMITER = "/--/";
	public static final int NONE_NODE = -1;
	// server listening port number
	public static final int PORT = 10000;

	// Message between activity and service
	public static final int MSG_REGISTER_CLIENT = 1;
	public static final int MSG_UPDATE_VIEWLIST = 2;
	public static final int MSG_TEST_CASE_1 = 3;
	public static final int MSG_TEST_CASE_2 = 4;
	public static final int MSG_RETREIVE = 5;
	public static final int MSG_ADD = 6;
	public static final int MSG_RETREIVE_RESULT = 7;
	public static final int MSG_DISABLE_BUTTON = 8;
	public static final int MSG_ENABLE_BUTTON = 9;
	public static final int MSG_JOIN = 9;
	// package type between each peer
	public static final int PACKAGE_JOIN = 1;
	public static final int PACKAGE_SET_UP = 2;
	public static final int PACKAGE_READY = 3;
	public static final int PACKAGE_RESET = 4;
	public static final int PACKAGE_STABLE = 5;
	public static final int PACKAGE_INSERT = 6;
	public static final int PACKAGE_LOOK_UP = 7;
	public static final int PACKAGE_KEY_VALUE = 8;
	// system status
	public static final int STATUS_INIT = 1;
	public static final int STATUS_READY = 2;
	public static final int STATUS_STABLE = 3;
	// define db related info
	public static final String AUTHORITY = "edu.buffalo.cse.cse486_586.simpledht.provider";
	public static final String PATH = "key_value";
	public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY
			+ "/" + PATH);

	public static final String DATABASE_NAME = "key_value.db";
	public static final int DATABSE_VERSION = 1;

	public static final String CONTENT_TYPE_ARTICLES_LIST = "vnd.android.cursor.dir/vnd.simpledht.key_value";
	public static final String CONTENT_TYPE_ARTICLE_ONE = "vnd.android.cursor.item/vnd.simpledht.key_value";

	public class KeyValueTable implements BaseColumns {
		private KeyValueTable() {
		}

		public static final String KV_TABLE = "key_value_tbl";
		public static final String COL_ID = "_id";
		public static final String COL_PROVIDER_KEY = "provider_key";
		public static final String COL_PROVIDER_VALUE = "provider_value";
	}
}
